package com.gfl.trivialrestclient.services;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.core.userdetails.UserDetails;

import com.gfl.trivialrestclient.model.User;

public interface LoginService {
	/**
	 * Heavyweight method to get logged authentication(may be touching the
	 * database). Use getLoggedUserDetails for fast and light access to logged
	 * authentication data.
	 */
	public User getLoggedUser();

	/**
	 * Lightweight method to get currently logged authentication details
	 */
	public UserDetails getLoggedUserDetails();

	public void webLogin(String login, String password,
			HttpServletRequest request, HttpServletResponse response)
			throws BadCredentialsException;

	public void logout();

	public boolean isLoggedIn();

}
